package cn.com.roy.thread.t4_2_3.readwritelockbegine3;

public class Run {
    public static void main(String[] args) {
        final Service service = new Service();
        Thread a = new Thread(){
            @Override
            public void run() {
                super.run();
                service.read();
            }
        };

        Thread b = new Thread(){
            @Override
            public void run() {
                super.run();
                service.write();
            }
        };
        a.setName("A");
        b.setName("B");
        a.start();
        b.start();
    }
}
